import { Injectable } from '@angular/core';
import { FrameContext } from '@farris/devkit';
import { MessagerService } from '@farris/ui-messager';
import { EMPTY, of } from 'rxjs';

@Injectable()
export class SbssDzyhpWlxxFormFrmControllerService {
  constructor(
    private frameContext: FrameContext,
    private messageService: MessagerService,
  ) {}

  /**
   * 新增前检查
   * 是否左侧选择了明细
   */
  public checkIsDetail(){
    let lbIsDetail = this.frameContext.uiState['lbbhIsDetail'];
    
    // if(!lbIsDetail){
      // this.messageService.info("请选择左侧明细类别!")
      // return EMPTY
    // }
  }

  /**
   * 组件视图初始化后事件
   * @remarks 
   * @returns 
   */
  componentAfterViewInit(): any {
    let querySb = this.frameContext.uiState['queryScheme1Binding']
    console.log(querySb)

    const defaultValue = {
            fieldConfigs: [
                {//下拉
                    labelCode: "zt",
                    value: {
                        key: "1",
                        value: [{ value: "1", name: "在用" }]
                    }
                },
            ]}
    
    this.frameContext.uiState['queryScheme1Binding'] = defaultValue
  }
}
